import java.awt.*;
import java.awt.event.*;

import javax.swing.*;

@SuppressWarnings("serial")
public class ServerGUI extends JFrame{

	Server server;
	JButton beenden;
	public static JTextArea protokoll;
	
	public static void appendProtokoll(String nachricht)
	{
		protokoll.setText(protokoll.getText() + "\n" + nachricht);
	}
	
	public ServerGUI()
	{		
		super("Server");
		setLayout(new BorderLayout());
		
		setSize(800, 600);
		setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		
		beenden = new JButton("Beenden");
		add(beenden, BorderLayout.SOUTH);
		
		protokoll = new JTextArea();
		protokoll.setEditable(false);
		add(protokoll, BorderLayout.CENTER);
		
		addWindowListener(new WindowAdapter() {
			public void windowClosing(WindowEvent e)
			{
				server.beenden();
//				Server.beenden();
			}
			
		});
		this.setVisible(true);
		server = new Server();
		server.go();
	}
	
	   public static void main(String[] args) {
	//		Spieler s = new Spieler("Sultan");
//			Stapel st = new Stapel();
		//	Karte[] blubb = new Karte[3];
			//st.nimmErsteKarten();

		   new ServerGUI();
	    }
	 
	

}
